import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: ()=>import('@/views/Home.vue'),
    redirect:"/main",
    children : [
        {path:'/main', name:'主要内容', component: ()=>import('@/views/Main.vue')},
        {path:'/goods', name:'商品详情', component: ()=>import('@/views/GoodsDetail.vue')},

    ]
  },
  {
    path:'/login',
    name:'login',
    component: ()=>import('@/views/Login.vue')
  },
    {
        path:'/myCart',
        name:'MyCart',
        component: ()=>import('@/views/MyCart.vue')

    },


]

const router = new VueRouter({
  mode:'history',
  base:process.env.BASE_URL,
  routes
})

export default router
